﻿using System;

namespace ServicesDirectory.UserControl
{
    public partial class PremiseDetail : System.Web.UI.UserControl
    {
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            lbtDetail1.Visible = true;
            lbtDetail2.Visible = true;
            lbtDetail3.Visible = true;
            lbtDetail4.Visible = true;
            lbtDetail5.Visible = true;
            lbtContract.Visible = true;
            pnDetail1.Visible = true;
            pnDetail2.Visible = false;
            pnDetail3.Visible = false;
            pnDetail4.Visible = false;
            pnDetail5.Visible = false;
            pnContract.Visible = false;
            pnFunding.Visible = false;
            btnInactive.Visible = true;
            lbtDetail1.Click += LbtDetail1Click;
            lbtDetail2.Click += LbtDetail2Click;
            lbtDetail3.Click += LbtDetail3Click;
            lbtDetail4.Click += LbtDetail4Click;
            lbtDetail5.Click += LbtDetail5Click;
            lbtContract.Click += LbtContractClick;
        }
          private void LbtContractClick(object sender, EventArgs e)
          {
              lbtDetail1.CssClass = "";
              lbtDetail2.CssClass = "";
              lbtDetail3.CssClass = "";
              lbtDetail4.CssClass = "";
              lbtDetail5.CssClass = "";
              lbtContract.CssClass = "active";


              pnDetail1.Visible = false;
              pnDetail2.Visible = false;
              pnDetail3.Visible = false;
              pnDetail4.Visible = false;
              pnDetail5.Visible = false;
              pnContract.Visible = true;
              pnFunding.Visible = false;
          }

        /// <summary>
        /// LBTs the detail5 click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void LbtDetail5Click(object sender, EventArgs e)
        {
            lbtDetail1.CssClass = "";
            lbtDetail2.CssClass = "";
            lbtDetail3.CssClass = "";
            lbtDetail4.CssClass = "";
            lbtDetail5.CssClass = "active";
            lbtContract.CssClass = "";
            

            pnDetail1.Visible = false;
            pnDetail2.Visible = false;
            pnDetail3.Visible = false;
            pnDetail4.Visible = false;
            pnDetail5.Visible = true;
            pnContract.Visible = false;
            pnFunding.Visible = false;
        }

        /// <summary>
        /// LBTs the detail4 click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void LbtDetail4Click(object sender, EventArgs e)
        {
            lbtDetail1.CssClass = "";
            lbtDetail2.CssClass = "";
            lbtDetail3.CssClass = "";
            lbtDetail4.CssClass = "active";
            lbtDetail5.CssClass = "";
            lbtContract.CssClass = "";
        

            pnDetail1.Visible = false;
            pnDetail2.Visible = false;
            pnDetail3.Visible = false;
            pnDetail4.Visible = true;
            pnDetail5.Visible = false;

            pnContract.Visible = false;
            pnFunding.Visible = false;
        }

        /// <summary>
        /// LBTs the detail3 click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void LbtDetail3Click(object sender, EventArgs e)
        {

            lbtDetail1.CssClass = "";
            lbtDetail2.CssClass = "";
            lbtDetail3.CssClass = "active";
            lbtDetail4.CssClass = "";
            lbtDetail5.CssClass = "";
            lbtContract.CssClass = "";
            lbtContract.CssClass = "";

            pnDetail1.Visible = false;
            pnDetail2.Visible = false;
            pnDetail3.Visible = true;
            pnDetail4.Visible = false;
            pnDetail5.Visible = false;
            pnContract.Visible = false;
            pnFunding.Visible = false;
        }

        /// <summary>
        /// LBTs the detail2 click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void LbtDetail2Click(object sender, EventArgs e)
        {

            lbtDetail1.CssClass = "";
            lbtDetail2.CssClass = "active";
            lbtDetail3.CssClass = "";
            lbtDetail4.CssClass = "";
            lbtDetail5.CssClass = "";
            lbtContract.CssClass = "";
           

            pnDetail1.Visible = false;
            pnDetail2.Visible = true;
            pnDetail3.Visible = false;
            pnDetail4.Visible = false;
            pnDetail5.Visible = false;
            pnContract.Visible = false;
            pnFunding.Visible = false;
        }

        /// <summary>
        /// LBTs the detail1 click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void LbtDetail1Click(object sender, EventArgs e)
        {

            lbtDetail1.CssClass = "active";
            lbtDetail2.CssClass = "";
            lbtDetail3.CssClass = "";
            lbtDetail4.CssClass = "";
            lbtDetail5.CssClass = "";
            
            lbtContract.CssClass = "";

            pnDetail1.Visible = true;
            pnDetail2.Visible = false;
            pnDetail3.Visible = false;
            pnDetail4.Visible = false;
            pnDetail5.Visible = false;
            pnContract.Visible = false;
            pnFunding.Visible = false;
        }
    }
}